import 'package:flutter/material.dart';

import 'Data.dart';
class ListPage extends StatelessWidget {

 List<ListTile> _getListTileWidget(BuildContext context){
   List<ListTile> list=[];
  data.forEach((element) {
   list.add(  ListTile(
     leading: Image.network(element["img"],width: 100,height: 100,fit: BoxFit.cover,),
     onTap:()=>{
     // Navigator.of(context).push(MaterialPageRoute(builder: (builder)=>Flex_Stack_Positioned_Widget()))
       Navigator.pushNamed(context, "/layout")
     },
     title:Text(element["title"],style: TextStyle(
         color: Colors.black,
         fontWeight: FontWeight.bold,
         fontSize: 15
     ),
       overflow: TextOverflow.ellipsis,) ,
     subtitle:Text(element["content"],style: TextStyle(
         color: Colors.black45,
         fontSize: 12
     ),) ,
   ));
 });
   return list;
 }
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: _getListTileWidget(context)
    );
  }
}
